const activity = {
  state: {
    activity: {},
    h5Config: {},
		hasWxPerssion: false,
		needRegister: false,
		location: {}
  },

  mutations: {
    SET_ACTIVITY: (state, row) => {
      state.activity = row
    },
    SET_NEEDREGISTER: (state, boo) => {
      state.needRegister = boo
    },
    SET_HASWXPERSSION: (state, boo) => {
      state.hasWxPerssion = boo
    },
    SET_H5CONFIG: (state, obj) => {
      state.h5Config = obj
    },
    SET_LOCATION: (state, location) => {
      state.location = location
			console.log(location, 9999)
    }
  },

  actions: {
    // 活动
    setActivity({ commit }, row) {
      commit('SET_ACTIVITY', row || {})
    },
    // 活动
    setNeedRegister({ commit }, boo) {
      commit('SET_NEEDREGISTER', boo || false)
    },
    // 活动
    setHasWxPerssion({ commit }, boo) {
      commit('SET_HASWXPERSSION', boo || false)
    },
    // 活动 h5 配置
    setH5Config({ commit }, row) {
      commit('SET_H5CONFIG', row || {})
    },
    // 活动 h5 配置
    setLocation({ commit }, location) {
      commit('SET_LOCATION', location || {})
    },
  },
  getters: {
    vuex_activity:(state) => state.activity,
    vuex_location:(state) => state.location,
    vuex_h5Config:(state) => state.h5Config,
		vuex_hasWxPerssion: (state) => state.hasWxPerssion,
		vuex_needRegister: (state) => state.needRegister
  }
}

export default activity
